package it.learn.kafka.infra.config;

import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
public class ConsumerConfig {

    /**
     * 类 DefaultKafkaConsumerFactoryCustomizer 在spring-boot-autoconfigure依赖中
     */
    // @Bean
    // public DefaultKafkaConsumerFactoryCustomizer consumerFactoryCustomizer(SomeBean someBean) {
    //     return new DefaultKafkaConsumerFactoryCustomizer() {
    //         @Override
    //         public void customize(DefaultKafkaConsumerFactory<?, ?> consumerFactory) {
    //             Map<String, Object> properties = consumerFactory.getConfigurationProperties();
    //             System.out.println("consumer-properties = " + properties);
    //
    //             HashMap<String, Object> map = new HashMap<>(properties);
    //             map.put("some.bean", someBean);
    //             // map.put(ConsumerConfig.INTERCEPTOR_CLASSES_CONFIG, MyConsumerInterceptor.class.getName());
    //             consumerFactory.updateConfigs(map);
    //         }
    //     };
    // }

}
